<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="pageContent">
	<form method="post" 
		action="dept_${empty deptId?'add':'edit' }.action"
		class="pageForm required-validate"
		onsubmit="return validateCallback(this, dialogAjaxDone);">
		<input type="hidden" name="deptId" value="${deptId }">
		<div class="pageFormContent nowrap" layoutH="60">
			<dl>
				<dt>
					<label>上级部门：</label>
				</dt>
				<select class="combox" name="parentCode">
					<option value="">---请选择---</option>
					<c:forEach var="dept" items="${departmentList}">
					<%-- 不包含自身且不包含子项  
					<c:if test="${dept.deptCode !=deptCode && dept.parent.deptCode !=deptCode}">
						<option value="${dept.deptCode }"  ${parentCode==dept.deptCode?"selected":""}>${dept.deptName }</option>
					</c:if> 
					--%>
						<option value="${dept.deptCode }"  ${parentCode==dept.deptCode?"selected":""}>${dept.deptName }</option>
					</c:forEach>
				</select>
			</dl>
			<dl>
				<dt>
					<label>部门名称：</label>
				</dt>
				<input type="text" maxlength="20" class="required" name="deptName" value="${deptName}" id="deptName" />
			</dl>
		</div>
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div></li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
	</form>
</div>
